/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.testis.utils.middleware;

import org.orm.PersistentException;
import org.orm.PersistentSession;
import org.testis.orm.manager.TestisDbPersistentManager;

/**
 * 
 * @author nurhat
 */
public class DbConnectionSupplier {

    public void closeDBConnection() throws PersistentException {
	TestisDbPersistentManager.instance().disposePersistentManager();
    }

    public PersistentSession openDBConnection() {
	try {
	    return TestisDbPersistentManager.instance().getSession();
	} catch (PersistentException ex) {
	    return null;
	}
    }
}
